package com.gin.no_gay_alliance.adpter.medal;

import android.content.Context;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;

import com.gin.nga.response.field.Medal;
import com.gin.no_gay_alliance.adpter.base.BaseBindingRecyclerViewAdapter;
import com.gin.no_gay_alliance.databinding.ItemMedalInUserCenterBinding;
import com.gin.no_gay_alliance.utils.ImageUtils;

import java.util.List;

/**
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/9/7 01:21
 **/
public class MedalInUserCenterAdapter extends BaseBindingRecyclerViewAdapter<ItemMedalInUserCenterBinding, Medal> {
    public MedalInUserCenterAdapter(Context context) {
        super(context);
    }

    public MedalInUserCenterAdapter(@NonNull Context context, @NonNull List<Medal> data) {
        super(context, data);
    }

    @Override
    protected void onBindViewHolder(ViewHolder<ItemMedalInUserCenterBinding> holder, @NonNull ItemMedalInUserCenterBinding b, int position, Medal item) {
        ImageUtils.loadMedal(context, item.getUrl(), b.iv);
        b.tvName.setText(item.getName());
        b.tvDescription.setText(item.getDescription());
    }

    @NonNull
    @Override
    protected ItemMedalInUserCenterBinding buildBinding(LayoutInflater inflater) {
        return ItemMedalInUserCenterBinding.inflate(inflater);
    }

    @Override
    protected boolean useZebraStripe() {
        return false;
    }
}
